<!-- 
    @author Wójcik Karol <wojcikk@student.agh.edu.pl>
    @licence http://www.gnu.org/copyleft/gpl.html GNU/GPL
-->

<div id="colOne">
    <%= render :partial => "menu" %>
</div>
<div id="colTwo">
	<% for lesson in @lessons %>
		<h3><%=h  "#{lesson.subject.name} - #{lesson.class_type.name}" %></h3>
	<% end %>
	<% if @lessons_users.blank? %>
    	<h1>Aktualnie nie ma dost&#281;pnych przypisanych zaj&#281;c do prowadz&#261;cych</h1>
	<% else %>
		<table>
			<tr>
			    <th>Prowadzacy</th> 
			    <th>LGrZaj</th>
			    <th>LGrRoz</th>
			</tr>
		<% for lessons_user in @lessons_users %>
			<tr>
				<td><%=h "#{lessons_user.user.mark.name} #{lessons_user.user.name} #{lessons_user.user.surname}" %></td>
				
				<td><%=h lessons_user.lgrzaj %></td>
				<td><%=h lessons_user.lgrroz %></td>
				<td><%= link_to 'Poka&#380;', :action => 'show', :id => lessons_user %></td>
	    		<td><%= link_to 'Zmie&#324;', :action => 'edit', :id => lessons_user, :back => params[:id] %></td>
	    		<td><%= link_to 'Usu&#324;', { :action => 'destroy', :id => lessons_user }, :confirm => 'Are you sure?', :post => true %></td>
			</tr>
		<% end %>
		</table>
	<% end %>
	<%= link_to 'Utw&#243;rz nowy', :action => 'assign', :id => params[:id] %>
	
</div>